// ##
#include "AtomicGenerators.h"
#include "IdGenerators.h"
#include "BoxDescriptor.h"

#if 1

#define  BOBOX_MODEL_LINE_END ""

#else

#define  BOBOX_MODEL_LINE_END "\n"

#endif
namespace jm4bbx {

	std::string genBox(const BoxDescriptorPtr& box) {
		std::stringstream stream;
		auto ids = box->getBoxIds();
		for (size_t i = 0; i < ids.size(); ++i) {
			stream << "box:" << ids[i] << "[" << box->getBoxName() << "]"
				<< "(" << box->getBoxParams() << ")," << BOBOX_MODEL_LINE_END;
		}
		return stream.str();

	}

	std::string genVia(ViaIdGenerator& gen, int fromId, int fromCol, int toId, 
		int toCol, const std::string& types) {

			std::stringstream stream;
			stream << "via:" << gen.getNextViaId() 
				<< "[" << fromId << ":" << fromCol << "]" 
				<< "{" << types << "}{}" 
				<< "("<< toId << ":" << toCol <<")," << BOBOX_MODEL_LINE_END;
			return stream.str();
	}

	std::string genTypes(const std::string& types, int multiplicity/* = 1*/) {
		std::stringstream stream;
		for (int i = 0; i < multiplicity; ++i) {
			stream << types << "(),";
		}
		return stream.str();
	}

} // namespace jm4bbx
